package com.mrx.compose.demo.view

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material.Button
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import com.mrx.compose.demo.util.UserInfoUtil

object HomeView : ComposeView() {

    @Composable
    override fun showView(onRouterChanged: (String) -> Unit) {
        Column(
            horizontalAlignment = Alignment.CenterHorizontally,
            verticalArrangement = Arrangement.Center,
            modifier = Modifier.fillMaxSize()
        ) {
            Text("Success")
            Button({
                logger.info("BackToLogin")
                UserInfoUtil.userToken = null
                onRouterChanged("/login")
            }) { Text("BackToLogin") }
        }
    }

}
